/*

 */
package com.insigma.business.qrcode.common.util;

import org.apache.commons.lang3.StringUtils;


public enum RestfulCodeEnum {

    
    SUCCESS("0", "处理成功"),


    
    INTERNAL_ERROR("81011003", "系统内部错误"),
    ;

    RestfulCodeEnum(final String code, final String desc) {
        this.code = code;
        this.desc = desc;
    }

    
    public static RestfulCodeEnum getByEnumCode(final String code) {
        /*if( StringUtils.isBlank(code)){
            return null;
        }

        if(MSDFErrorCodeEnum.getByCode(code) != null){
            return INTERNAL_ERROR;
        }*/

        for (RestfulCodeEnum element : values()) {
            if(StringUtils.equals(element.getCode(),code)){
                return element;
            }
        }

        return INTERNAL_ERROR;
    }

    
    private String code;

    
    private String desc;

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

}
